extends Control

func _on_敲山震虎_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || GameUtils.checkActionEnough(SpendData.COST_妖术_敲山震虎):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.妖术_敲山震虎)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()


func _on_绝命献祭_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_妖术_绝命献祭):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.妖术_绝命献祭)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()


func _on_玄冰禁锢_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_妖术_玄冰禁锢):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.妖术_玄冰禁锢)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()


func _on_瘟疫传播_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_妖术_瘟疫传播):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.妖术_瘟疫传播)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()

# 这个技能太烂了，删掉先
func _on_敲山震虎_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("指定一个地形是山地的落地，使其周围的敌方大子获得怯战\n消耗：2点能量")


func _on_绝命献祭_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("绝命献祭：消耗0点能量，献祭大子及其子系，每献祭3个大子获得1点行能量")


func _on_玄冰禁锢_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("玄冰禁锢：消耗2点能量，选择一个敌方大子，使其获得冰冻状态。冰冻：无法行动，持续一回合")


func _on_瘟疫传播_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("瘟疫传播：消耗4点能量，选择一个敌方大子，使其获得中毒状态。中毒：回合结束时触发毒爆，自身若死亡，向周围己方大子传播中毒状态")


func _on_mouse_exited():
	var ui = ObjectManager.gameManager.ui as UI
	ui.closeDesc()
